<%@ page import="java.sql.Connection" %>
<%@ page import="java.util.concurrent.Future" %>
<%@ page import="java.sql.Statement" %>
<%@ page import="java.sql.ResultSet" %>
<%@ page import="org.apache.tomcat.jdbc.pool.PoolProperties" %>
<%@ page import="org.apache.tomcat.jdbc.pool.DataSource" %>
<%@ page import="com.tencent.albert.weixin.driver.servlet.DaemonServlet" %>
<%--
  Created by IntelliJ IDEA.
  User: albertzhu
  Date: 15/2/11
  Time: 下午5:23
  To change this template use File | Settings | File Templates.
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page trimDirectiveWhitespaces="true" %>
<html>
  <head>
    <title>Test</title>
  </head>
  <body>
<%

    Connection con = DaemonServlet.getConn(); //should return instantly
    try {
        Statement st = con.createStatement();
        ResultSet rs = st.executeQuery("select * from user");
        int cnt = 1;
        while (rs.next()) {
            System.out.println((cnt++)+". Host:" +rs.getString("Host")+
                    " User:"+rs.getString("User")+" Password:"+rs.getString("Password"));
        }
        rs.close();
        st.close();
    } finally {
        if (con!=null) try {con.close();}catch (Exception ignore) {}
    }
%>
  </body>
</html>
